package org.bitejiuyeke.lesson01;

public class Demo02_Runnable {
    public static void main(String[] args) {
        MyRunnable01 myRunnable01=new MyRunnable01();
        Thread thread=new Thread(myRunnable01);
        thread.start();
        while (true) {
            try {
                //休眠程序
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(222);
        }
    }
}
class MyRunnable01 implements  Runnable{
    @Override
    public void run() {
        while (true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(333);
        }
    }
}


